<template>
  <div class="myshop">
    <van-nav-bar
      title="我的店铺"
      left-text=""
      left-arrow
      @click-left="onClickLeft"
      fixed
      placeholder
    />

    <div class="main">
      <div class="content">
        <ul>
          <li @click="uploadCommoditiesd">上传商品</li>
          <router-link to="/onlineshop"><li>在线商品</li></router-link>
          <li>已售商品</li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
import { Toast } from "vant"
export default {
  name: "myshop",
  components: {},
  methods: {
    onClickLeft() {
      this.$router.push("/my")
    },
    uploadCommoditiesd() {
      // 检查用户是否进行校园认证
      let isCheck = true
      this.$api.uploadcommoditiesd.examinCheck().then((res) => {
        console.log(res)
        let arr = res.data
        if (arr.length == 0 || arr[0].student_attesation == 0) {
          Toast("请先进行校园认证")
        } else {
          this.$router.push("/uploadcommoditiesd")
        }
      })
    },

    onlineShop() {
      this.$router.push("/myshop/onlineshop")
    },
  },
}
</script>

<style lang="less" scoped>
.myshop {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;

  .main {
    flex: 1;
    background-color: #f7f8fa;

    .content {
      width: 100%;
      height: 100%;
      margin-top: 1.25rem /* 20/16 */;
      ul {
        display: flex;
        justify-content: space-around;
        flex-wrap: wrap;

        li {
          width: 6.25rem /* 100/16 */ /* 200/16 */;
          height: 6.25rem /* 100/16 */ /* 200/16 */;
          background-color: #fff;
          box-shadow: 0 5px 15px -5px rgba(0, 0, 0, 0.5);
          border-radius: 0.9375rem /* 15/16 */;
          text-align: center;
          line-height: 6.25rem /* 100/16 */;
        }
      }
    }
  }
}
</style>
